package entity;

import service.entity.GoodsStoreDTO;

import java.util.Date;

/**
 * Created by asus on 2017/6/22.
 */
public class GoodsInStore {
    private Long id;
    private Long goodsId;
    private Long storeId;
    private Integer inQuantity;
    private Date inDate;

    public GoodsInStore() {
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getGoodsId() {
        return goodsId;
    }

    public void setGoodsId(Long goodsId) {
        this.goodsId = goodsId;
    }

    public Long getStoreId() {
        return storeId;
    }

    public void setStoreId(Long storeId) {
        this.storeId = storeId;
    }

    public Integer getInQuantity() {
        return inQuantity;
    }

    public void setInQuantity(Integer inQuantity) {
        this.inQuantity = inQuantity;
    }

    public Date getInDate() {
        return inDate;
    }

    public void setInDate(Date inDate) {
        this.inDate = inDate;
    }

    public static GoodsInStore convertDTOtoEntity( GoodsInStore goodsInStore,GoodsStoreDTO goodsStoreDTO){
        goodsInStore.setId(goodsStoreDTO.getId());
        goodsInStore.setGoodsId(goodsStoreDTO.getGoodsId());
        goodsInStore.setStoreId(goodsStoreDTO.getStoreId());
        goodsInStore.setInQuantity(goodsStoreDTO.getQuantity());
        goodsInStore.setInDate(goodsStoreDTO.getDate());
        return goodsInStore;
    }

    @Override
    public String toString() {
        return "GoodsInStore{" +
                "id=" + id +
                ", goodsId=" + goodsId +
                ", storeId=" + storeId +
                ", inQuantity=" + inQuantity +
                ", inDate=" + inDate +
                '}';
    }
}
